package com.iven.xie.designpattern.memento.demo;

import java.util.ArrayList;
import java.util.List;

/**
 * 管理者
 *
 * @author xiezhendong
 * @date 2021/8/3
 */
public class Caretaker {
    private Memento memento;

    public void setMemento(Memento m) {
        memento = m;
    }

    public Memento getMemento() {
        return memento;
    }

    private List<Memento> mementoList = new ArrayList<Memento>();

    public void add(Memento state) {
        mementoList.add(state);
    }

    public Memento get(int index) {
        return mementoList.get(index);
    }
}
